function Choise(name, winner,loser){
	this.init(name, winner,loser);
}

Choise.prototype = {
		name:"",
		winner: new Array(),
		loser: new Array(),
		init : function(name){
					this.name=name;
				},
		compare:  function(another){
					if(another.name==this.name){
						return 0;
					}
					for(var i=0; i<this.winner.length; i++){
						if(another.name==this.winner[i].name){
							return 1;
						}
					}
					return -1;
				},
		setWinner: function(winner){
					this.winner[this.winner.length]=winner;
				},
		setLoser: function(loser){
					this.loser[this.loser.length]=loser;
				}
	
};


var rock=new Choise("rock");
var paper=new Choise("paper");
var scissors=new Choise("scissors");
var lizard=new Choise("lizard");
var spock=new Choise("spock");

var choises=new Array(rock,paper,scissors,lizard,spock);

rock.setWinner(paper);
rock.setWinner(spock);
rock.setLoser(lizard);
rock.setLoser(scissors);

paper.setWinner(scissors);
paper.setWinner(lizard);
paper.setLoser(rock);
paper.setLoser(spock);

scissors.setWinner(rock);
scissors.setWinner(spock);
scissors.setLoser(paper);
scissors.setLoser(lizard);

spock.setWinner(paper);
spock.setWinner(lizard);
spock.setLoser(scissors);
spock.setLoser(rock);

lizard.setWinner(rock);
lizard.setWinner(scissors);
lizard.setLoser(paper);
lizard.setLoser(spock);

